package com.neuedu.action.web;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.neuedu.model.Laws;
import com.neuedu.service.LawsService;


@Controller
@RequestMapping("/laws")
public class LawsWebAction {
	@Autowired
	private LawsService LawsService;
	
	@RequestMapping(value = "/findAll")
	public String findAll(HttpServletRequest request, HttpServletResponse response) throws Exception {
	/*	int page = Integer.parseInt(request.getParameter("page"));
		int rows = Integer.parseInt(request.getParameter("rows"));*/
		Map<String, Object> map = new HashMap<String, Object>();
		Map<String, Object> pageMap = new HashMap<String, Object>();
		pageMap.put("startPage", 0);
		pageMap.put("endPage", 7);

		List<Laws> u = LawsService.findAll(pageMap);
		request.setAttribute("lawsList", u);

		return "ulaws";
	}
}
